<include file="Public:header" />
<script>
$(document).ready(function(e) {
    $('.showcurimg').each(function(index, element) {
        $(this).click(function(e) {
            $(this).find('img.img').show();
        });
		$(this).mouseleave(function(e) {
            $(this).find('img.img').hide();
        });
    });
});function selectNews(id){
	
	var ids = new Array();
	$('#news_ids input[value!="'+id+'"]').each(function(index, element){
		ids.push($(this).val());
	});
	if($('#news_ids input[value="'+id+'"]').length <=0){
		ids.push(id);
	}
	$.ajax({
		url:"{:U('selectNews')}",
		data:"id="+id+"&modules_id={$modules_id}",
		dataType:"json",
		type:'POST',
		success: function(data){
			if(data.status == 1){
				if(data.type==1){
					$('#title'+id).addClass('selectednews');
					$(window.parent.document).find('#NewsList_').append('<li sortkey="0" id="news0_'+id+'" style="border:1px solid #ccc; width:100px; position:relative; height:100px; margin:4px; float:left;"><img src="'+$('#title'+id).attr('imgurl')+'" width="100%" height="100%"><a href="javascript:void(0);" onclick="sortListInfo(\'up\',this)" style="position:absolute; left:0px; bottom:0px;">[&lt;]</a> <a href="javascript:void(0);" onclick="sortListInfo(\'down\',this)" style="position:absolute; bottom:0px; right:0px;">[&gt;]</a><a href="javascript:;" onClick="removeListInfoCate('+id+',0);" style="font-size:20px; height:24px; width:24px; line-height:24px; text-align:center; position:absolute; top:0px; right:0px; color:#fff; background:#f00; border-radius:20px;">×</a><input type="hidden" name="modulesContent[]" value="0_'+id+'"></li>');
				}else{
					$('#title'+id).removeClass('selectednews');
					$(window.parent.document).find('#NewsList_ #news0_'+id).remove();
					
				}
			}else{
				alert(data.info);
			}
		}
	});
}
</script>	<style> 
.header{display:none;}
	.w790{margin-top:0px;}
	.selectednews{color:#0F0; font-weight:bold; border:2px solid #FF0004 !important;}
</style>
<div class="container main"> <include file="Public:left" />
  <div class="w790">
    <div class="h"><a href="{:U('Product/selectNews',array('modules_id' => $modules_id))}" class="btn btn-info"><i class="glyphicon glyphicon-plus"></i>选择产品</a>
    
    
    
    
    
    
     <a data-toggle="modal" data-target="#myModal" href="javascript:void(0);" class="btn btn-info"><i class="glyphicon glyphicon-search"></i>搜索</a>
      </div>
    <volist name="list" id="vo">
    
    <div class="media NewsListMobile <if condition="in_array($vo['id'],$selectedid) and $vo['module'] eq 0">selectednews</if>" id="title{$vo.id}" class="<if condition="in_array($vo['id'],$selectedid) and $vo['module'] eq 0">selectednews</if>" onclick="selectNews({$vo.id});" imgurl="{:getThumbPath($vo['img_url'])}">
  <div class="media-left media-middle">
    
      <img class="media-object" src="<notempty name="vo['img_url']">{:getThumbPath($vo['img_url'])}<else/>__PUBLIC__/logo.gif</notempty>" alt="...">

  </div>
  <div class="media-body">
    <h4 class="media-heading">{$vo.title}</h4>
    <p></p>
     
  </div>
</div>
    
    
    
    </volist>
    <div class="pages">{$pages}</div>
  </div>
  <div class="clear"></div>
</div>



    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
      <div class="modal-dialog" role="document">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <h4 class="modal-title" id="myModalLabel">搜索</h4>
          </div>
          <div class="modal-body">
             <form action="{:U('index')}" method="get" class="form-inline">
      <label class="checkbox-inline"><input name="status" type="checkbox" <eq name="status" value="1">checked="ckecked"</eq> value="1" />状态</label>
      <label class="checkbox-inline"><input name="is_hot" type="checkbox" <eq name="is_hot" value="1">checked="ckecked"</eq> value="1" />热门</label>
      <label class="checkbox-inline"><input name="is_rec" type="checkbox" <eq name="is_rec" value="1">checked="ckecked"</eq> value="1" />推荐</label>
      <label class="checkbox-inline"><input name="is_top" type="checkbox" <eq name="is_top" value="1">checked="ckecked"</eq> value="1" />置顶</label>
      
     <div style="height:10px;"></div>

      <select name="category_id" id="pid" class="form-control">
          <option value="0">请选择栏目</option>
          <volist name="pid_list" id="vo">
            <option <eq name="category_id" value="$vo['id']">selected="selected"</eq> value="{$vo.id}">{$vo.title}</option>
            <volist name="vo['sub']" id="svo">
               <option <eq name="category_id" value="$svo['id']">selected="selected"</eq> value="{$svo.id}">{:getdeepstr($svo['deep'])}{$svo.title}</option>
            </volist>
          </volist>
        </select>
        <br>

        <input type="hidden" name="pagesize" value="{$pagesize}" />
        <input type="text" name="keywords" placeholder="输入搜索关键词" class="form-control" value="{$keywords}" /><br>

        <button type="submit" class="btn btn-default">搜索</button>
      </form>
          </div>
          
        </div> 
      </div>
    </div>


<include file="Public:footer" />